package com.yc.demo.test01;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Enumeration;

@WebServlet(name = "AddMyServlet", value = "/AddMyServlet")
public class AddMyServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        HttpSession session = request.getSession();
        String myself = request.getParameter("myself");
        session.setAttribute("myself",myself);
        String[] hobby = (String[]) session.getAttribute("hobby");
        String xueli = (String) session.getAttribute("xueli");
        String myself1 = (String) session.getAttribute("myself");
        PrintWriter out = response.getWriter();
        out.printf("兴趣爱好 ： ");
        for (String n : hobby){
            out.printf("%s ",n);
        }
        out.printf("<br>学历 ： %s",xueli);
        out.printf("<br>个人经历 ： %s",myself1);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
